Friend MustInherit Class cNeighbourSurveySequence

    Protected pSequence As List(Of cNeighbourSurveyRange)

    Protected Sub New()

        pSequence = New List(Of cNeighbourSurveyRange)

    End Sub

    Friend ReadOnly Property CountOfSteps() As Integer
        Get
            CountOfSteps = pSequence.Count
        End Get
    End Property

    Friend ReadOnly Property RangeBySequenceIndexBaseOne(ByVal Index As Integer) As cNeighbourSurveyRange
        Get
            Return pSequence.Item(Index - 1)
        End Get
    End Property

End Class

Friend Class cNeighbourSurveyRange

    Private pInnerLimit As Integer
    Private pOuterLimit As Integer

    Friend Sub New(ByVal InnerLimit As Integer, ByVal OuterLimit As Integer)
        pInnerLimit = InnerLimit
        pOuterLimit = OuterLimit
    End Sub

    Friend ReadOnly Property InnerLimit() As Integer
        Get
            Return pInnerLimit
        End Get
    End Property

    Friend ReadOnly Property OuterLimit() As Integer
        Get
            Return pOuterLimit
        End Get
    End Property

End Class

Friend Class cNeighbourSurveySequenceInnerIncreasing

    Inherits cNeighbourSurveySequence

    Public Sub New(ByVal InnerLowerLimit As Integer, ByVal InnertUpperLimit As Integer, ByVal OuterLimit As Integer, ByVal StepSize As Integer)

        MyBase.New()

        Dim InnerLimit As Integer

        Debug.Assert(StepSize >= 1)

        For InnerLimit = InnerLowerLimit To InnertUpperLimit Step StepSize
            pSequence.Add(New cNeighbourSurveyRange(InnerLimit, OuterLimit))
        Next

    End Sub

End Class


Friend Class cNeighbourSurveySequenceOuterIncreasing

    Inherits cNeighbourSurveySequence

    Public Sub New(ByVal InnerLimit As Integer, ByVal OuterLowerLimit As Integer, ByVal OuterUpperLimit As Integer, ByVal StepSize As Integer)

        MyBase.New()

        Dim OuterLimit As Integer

        Debug.Assert(StepSize >= 1)

        For OuterLimit = OuterLowerLimit To OuterUpperLimit Step StepSize
            pSequence.Add(New cNeighbourSurveyRange(InnerLimit, OuterLimit))
        Next

    End Sub

End Class


